package com.itheima.a01mathdemo1;

public class MathDemo1 {
    public static void main(String[] args) {
        /*为什么没有2为自幂数，求有几个四叶玫瑰数，五角星数*/
        int count = 0;

        for (int i = 10000; i <= 99999; i++) {

            int ge = i % 10;
            int shi = i / 10 % 10;
            int bai = i / 100 % 10;
            int qian = i / 1000 % 10;
            int wan = i / 10000 % 10;

            double sum = Math.pow(ge, 5) + Math.pow(shi, 5)+ Math.pow(bai, 5)+ Math.pow(qian, 5)+ Math.pow(wan, 5);

            if (sum == i) {
                System.out.println(i);
                count++;
            }
        }
        System.out.println(count);

    }
}
